var _ = require("lodash");
// _.dropWhile(array, [predicate=_.identity])
// 创建一个切片数组，去除array中从起点开始到 predicate 返回假值结束部分
// 方法用于从数组的开头移除连续满足指定条件的元素，直到遇到第一个不满足该条件的元素为止

var users = [
  { user: "barney", active: false },
  { user: "fred", active: false },
  { user: "pebbles", active: true },
];

let a = _.dropWhile(users, function (o) {
  return !o.active;
});
// console.log(a);

let b = _.dropWhile(users, { user: "barney", active: false });
console.log(b);

let c = _.dropWhile(users, ["active", true]);
// console.log(c);

let d = _.dropWhile(users, "active");
// console.log(d);
